from pymongo import MongoClient


def get_Save_DB():
    url = "192.168.1.99"
    # url = "tit.pub"
    # url = "localhost"
    port = 27017
    db_name = 'comic_spider_db'
    client = MongoClient(url, port)
    client[db_name].authenticate('xmtj', '0-=p[]P{}', 'admin')
    db = client[db_name]
    return db


def get_Spider_DB():
    url = "192.168.1.99"
    # url = "localhost"
    port = 27017
    db_name = 'resultdb'
    client = MongoClient(url, port)
    client[db_name].authenticate('xmtj', '0-=p[]P{}', 'admin')
    db = client[db_name]
    return db

def getOriginDB():
    url = "120.27.216.40"
    # url = "localhost"
    port = 27018
    db_name = 'resultdb'
    client = MongoClient(url, port)
    client[db_name].authenticate('watcher', '0-=p[]P{}', 'resultdb')
    db = client[db_name]
    return db